﻿Ext.namespace('FantastPlatform', 'FantastPlatform.UI');
FantastPlatform.UI.CaseCallBack = function (config) {
    Ext.apply(this, config);
    var cff = new Ext.form.FieldSet({
        title: '图片信息',
        autpHeight: true,
        defaultType: 'textfield'
    });
    var mark = true;
    if (this.photosInfoId && this.photosInfoId != 0) {
        mark = false;
    }
    this.items = [{
        layout: 'column',
        border: false,
        labelSeparator: '：',
        items: [
          {
              columnWidth: 1,
              border: false,
              layout: 'form',
              items: [new Ext.form.TextArea({
                  fieldLabel: '<font color="red">*</font>&nbsp;&nbsp;回访内容',
                  name: 'Description',
                  allowBlank: false,
                  blankText: "不能为空",
                  height:200,
                  anchor: '80%'
              })]
          }, {
              columnWidth: 1,
              layout: 'form',
            //  hidden: eval(mark),
              border: false,
              items: [new FantastPlatform.UI.PhotoField({
                  fieldLabel: '选择图片',
                  height: 350,
                  name: 'ImageUrl',
                  anchor: '90%'
              }
            )]
          }
        ]
    }];


    FantastPlatform.UI.CaseCallBack.superclass.constructor.call(this, {
        bodyStyle: 'padding:5px',
        collapsible: true,
        labelAlign: 'right',
        //width: 410,
        autoScroll: true,
        border: false
    });
};
Ext.extend(FantastPlatform.UI.CaseCallBack, Ext.form.FormPanel, {
    onRender: function (ct, position) {
        FantastPlatform.UI.CaseCallBack.superclass.onRender.call(this, ct, position);
        if (this.photosInfoId && this.photosInfoId != 0) {
            this.add(new Ext.form.Hidden({ name: 'CaseId', value: this.photosInfoId }));
            this.form.load({
                url: 'Service/CaseCallBackService.aspx?Action=Get',
                params: { id: this.photosInfoId },
                waitMsg: '正在读取数据...',
                waitTitle: '请稍后',
                failure: function (form, action) {
                    if (action.failureType != 'client') {
                        showErrorMessage('操作失败', action.result.message, '');
                    }
                }
            })
        }
    }

})